import { Module, forwardRef } from '@nestjs/common';
import { UserService } from './user.service';
import { UserController } from './user.controller';
import { TypeOrmModule } from '@nestjs/typeorm';
import { User } from './entities/user.entity';
import { Repository } from 'typeorm';
import { AuthModule } from 'src/auth/auth.module';

@Module({
  imports: [TypeOrmModule.forFeature([User]), forwardRef(() => AuthModule)],//forFeature()方法注册的每个实体都将自动添加到配置对象的实体数组中
  controllers: [UserController],
  providers: [UserService, Repository],
  exports: [UserService]//将用户服务暴露给其他模块使用
})
export class UserModule { }
